export default {
  namespaced: true,
  state: () => ({
    notifyMessage: {},
    groupNotifyMessage: {},
    notifyCount: 0,
    nowChats: [],
  }),
  actions: {
    setNotifyMessage: (store, data) => {
      store.commit("SET_NOTIFY_MESSAGE", data);
    },
    setGroupNotifyMessage: (store, data) => {
      store.commit("SET_GROUP_NOTIFY_MESSAGE", data);
    },
    setAddNotifyCount: (store, count) => {
      store.commit("SET_ADD_NOTIFY_COUNT", count);
    },
    setMinusNotifyCount: (store, count) => {
      store.commit("SET_MINUS_NOTIFY_COUNT", count);
    },
    setNowChats: (store, chats) => {
      store.commit("SET_NOW_CHATS", chats);
    },
  },
  mutations: {
    SET_NOTIFY_MESSAGE: (state, data) => {
      state.notifyMessage = data;
    },
    SET_GROUP_NOTIFY_MESSAGE(state, data) {
      state.groupNotifyMessage = data;
    },
    SET_ADD_NOTIFY_COUNT(state, count) {
      state.notifyCount += count;
    },
    SET_MINUS_NOTIFY_COUNT(state, count) {
      state.notifyCount -= count;
    },
    SET_NOW_CHATS(state, chats) {
      state.nowChats = chats;
    },
  },
};
